Optimal. Leaf size=102 \[ \frac {2 a^2 (2 B+3 C) \sin (c+d x)}{3 d}+\frac {a^2 (2 B+3 C) \sin (c+d x) \cos (c+d x)}{6 d}+\frac {1}{2} a^2 x (2 B+3 C)+\frac {B \sin (c+d x) \cos ^2(c+d x) (a \sec (c+d x)+a)^2}{3 d} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.23, antiderivative size = 102, normalized size of antiderivative = 1.00, number of steps used = 6, number of rules used = 6, integrand size = 40, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.150, Rules used = {4072, 4013, 3788, 2637, 4045, 8} \[ \frac {2 a^2 (2 B+3 C) \sin (c+d x)}{3 d}+\frac {a^2 (2 B+3 C) \sin (c+d x) \cos (c+d x)}{6 d}+\frac {1}{2} a^2 x (2 B+3 C)+\frac {B \sin (c+d x) \cos ^2(c+d x) (a \sec (c+d x)+a)^2}{3 d} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 8
Rule 2637
Rule 3788
Rule 4013
Rule 4045
Rule 4072
Rubi steps
\begin {align*} \int \cos ^4(c+d x) (a+a \sec (c+d x))^2 \left (B \sec (c+d x)+C \sec ^2(c+d x)\right ) \, dx &=\int \cos ^3(c+d x) (a+a \sec (c+d x))^2 (B+C \sec (c+d x)) \, dx\\ &=\frac {B \cos ^2(c+d x) (a+a \sec (c+d x))^2 \sin (c+d x)}{3 d}+\frac {1}{3} (2 B+3 C) \int \cos ^2(c+d x) (a+a \sec (c+d x))^2 \, dx\\ &=\frac {B \cos ^2(c+d x) (a+a \sec (c+d x))^2 \sin (c+d x)}{3 d}+\frac {1}{3} (2 B+3 C) \int \cos ^2(c+d x) \left (a^2+a^2 \sec ^2(c+d x)\right ) \, dx+\frac {1}{3} \left (2 a^2 (2 B+3 C)\right ) \int \cos (c+d x) \, dx\\ &=\frac {2 a^2 (2 B+3 C) \sin (c+d x)}{3 d}+\frac {a^2 (2 B+3 C) \cos (c+d x) \sin (c+d x)}{6 d}+\frac {B \cos ^2(c+d x) (a+a \sec (c+d x))^2 \sin (c+d x)}{3 d}+\frac {1}{2} \left (a^2 (2 B+3 C)\right ) \int 1 \, dx\\ &=\frac {1}{2} a^2 (2 B+3 C) x+\frac {2 a^2 (2 B+3 C) \sin (c+d x)}{3 d}+\frac {a^2 (2 B+3 C) \cos (c+d x) \sin (c+d x)}{6 d}+\frac {B \cos ^2(c+d x) (a+a \sec (c+d x))^2 \sin (c+d x)}{3 d}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A] time = 0.19, size = 61, normalized size = 0.60 \[ \frac {a^2 (3 (7 B+8 C) \sin (c+d x)+3 (2 B+C) \sin (2 (c+d x))+B \sin (3 (c+d x))+12 B d x+18 C d x)}{12 d} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [A] time = 0.46, size = 70, normalized size = 0.69 \[ \frac {3 \, {\left (2 \, B + 3 \, C\right )} a^{2} d x + {\left (2 \, B a^{2} \cos \left (d x + c\right )^{2} + 3 \, {\left (2 \, B + C\right )} a^{2} \cos \left (d x + c\right ) + 2 \, {\left (5 \, B + 6 \, C\right )} a^{2}\right )} \sin \left (d x + c\right )}{6 \, d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [A] time = 0.26, size = 142, normalized size = 1.39 \[ \frac {3 \, {\left (2 \, B a^{2} + 3 \, C a^{2}\right )} {\left (d x + c\right )} + \frac {2 \, {\left (6 \, B a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} + 9 \, C a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} + 16 \, B a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 24 \, C a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 18 \, B a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 15 \, C a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )\right )}}{{\left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + 1\right )}^{3}}}{6 \, d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [A] time = 1.20, size = 116, normalized size = 1.14 \[ \frac {\frac {B \,a^{2} \left (2+\cos ^{2}\left (d x +c \right )\right ) \sin \left (d x +c \right )}{3}+2 B \,a^{2} \left (\frac {\cos \left (d x +c \right ) \sin \left (d x +c \right )}{2}+\frac {d x}{2}+\frac {c}{2}\right )+a^{2} C \left (\frac {\cos \left (d x +c \right ) \sin \left (d x +c \right )}{2}+\frac {d x}{2}+\frac {c}{2}\right )+B \,a^{2} \sin \left (d x +c \right )+2 a^{2} C \sin \left (d x +c \right )+a^{2} C \left (d x +c \right )}{d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [A] time = 0.39, size = 110, normalized size = 1.08 \[ -\frac {4 \, {\left (\sin \left (d x + c\right )^{3} - 3 \, \sin \left (d x + c\right )\right )} B a^{2} - 6 \, {\left (2 \, d x + 2 \, c + \sin \left (2 \, d x + 2 \, c\right )\right )} B a^{2} - 3 \, {\left (2 \, d x + 2 \, c + \sin \left (2 \, d x + 2 \, c\right )\right )} C a^{2} - 12 \, {\left (d x + c\right )} C a^{2} - 12 \, B a^{2} \sin \left (d x + c\right ) - 24 \, C a^{2} \sin \left (d x + c\right )}{12 \, d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [B] time = 2.87, size = 98, normalized size = 0.96 \[ B\,a^2\,x+\frac {3\,C\,a^2\,x}{2}+\frac {7\,B\,a^2\,\sin \left (c+d\,x\right )}{4\,d}+\frac {2\,C\,a^2\,\sin \left (c+d\,x\right )}{d}+\frac {B\,a^2\,\sin \left (2\,c+2\,d\,x\right )}{2\,d}+\frac {B\,a^2\,\sin \left (3\,c+3\,d\,x\right )}{12\,d}+\frac {C\,a^2\,\sin \left (2\,c+2\,d\,x\right )}{4\,d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [F(-1)] time = 0.00, size = 0, normalized size = 0.00 \[ \text {Timed out} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________